//
//  ActivityCell.m
//  12.30_homework_豆瓣电影MVC
//
//  Created by dllo on 15/12/30.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "ActivityCell.h"
// MARK:VIEW_CENTER_X:屏中心x轴
#define VIEW_CENTER_X self.view.center.x

// MARK:VIEW_CENTER_Y:屏中心y轴
#define VIEW_CENTER_Y self.view.center.y

// MARK:HEIGHT:屏高
#define HEIGHT self.contentView.frame.size.height

// MARK:WIDTH:屏宽
#define WIDTH self.contentView.frame.size.width


@implementation ActivityCell

- (void)dealloc{
    [_bigImage release];
    [_littelImage release];
    [_title release];
    [_timeImage release];
    [_time release];
    [_addressImage release];
    [_address release];
    [_categoryImage release];
    [_category_name release];
    [_wisher_count release];
    [_participant_count release];
    [_picImage release];
    [_MyTitle release];
    [_MyTime release];
    [_MyAddress release];
    [_MyCategory_name release];
    [_MyPic_Image release];
    [_MyWisher_count release];
    [_MyParticipant_count release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self creatCell];
        
    }
    return self;
}

- (void)creatCell {
    
    self.bigImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_bigImage];
    [_bigImage release];
    
    self.title = [[UILabel alloc] init];
    [self.contentView addSubview:_title];
    [_title release];
    
    self.littelImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_littelImage];
    [_littelImage release];
    
    self.timeImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_timeImage];
    [_timeImage release];
    
    self.time = [[UILabel alloc] init];
    [self.contentView addSubview:_time];
    [_time release];
    
    self.addressImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_addressImage];
    [_addressImage release];
    
    self.address = [[UILabel alloc] init];
    [self.contentView addSubview:_address];
    [_address release];
    
    self.categoryImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_categoryImage];
    [_categoryImage release];
    
   
    self.category_name = [[UILabel alloc] init];
    [self.contentView addSubview:_category_name];
    [_category_name release];
    
    self.wisher_count = [[UILabel alloc] init];
    [self.contentView addSubview:_wisher_count];
    [_wisher_count release];
    
    self.participant_count = [[UILabel alloc] init];
    [self.contentView addSubview:_participant_count];
    [_participant_count release];
    
    self.picImage = [[UIImageView alloc] init];
    [_littelImage addSubview:_picImage];
    [_picImage release];
    
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    _bigImage.frame = CGRectMake(15, 10, WIDTH - 30, HEIGHT - 20);
    _bigImage.image = [UIImage imageNamed:@"bg_eventlistcell.png"];
    
    _title.frame = CGRectMake(30, 20, WIDTH - 50, 30);
    
    _littelImage.frame = CGRectMake(20, 50, WIDTH - 40, HEIGHT - 75);
    _littelImage.backgroundColor = [UIColor whiteColor];
    
    _timeImage.frame = CGRectMake(25, 60, 25, 25);
    _timeImage.layer.cornerRadius = 10;
    _timeImage.image = [UIImage imageNamed:@"icon_date@2x.png"];
    
    _time.frame = CGRectMake(60, 60, 180, 25);
    _time.font = [UIFont systemFontOfSize:13];
    _time.backgroundColor = [UIColor clearColor];
    
    _addressImage.frame = CGRectMake(25, 90, 25, 25);
    _addressImage.image = [UIImage imageNamed:@"icon_spot@2x.png"];
    
    _address.frame = CGRectMake(60, 90, 180, 25);
    _address.backgroundColor = [UIColor clearColor];
    
    _categoryImage.frame = CGRectMake(25, 120, 25, 25);
    _categoryImage.image = [UIImage imageNamed:@"icon_catalog@2x.png"];
    
    _category_name.frame = CGRectMake(60, 120, 100, 25);
    _category_name.backgroundColor = [UIColor clearColor];
    
    _wisher_count.frame = CGRectMake(30, 150, 120, 25);
    _wisher_count.font = [UIFont systemFontOfSize:15];
    _wisher_count.textColor = [UIColor redColor];
    _wisher_count.backgroundColor = [UIColor clearColor];
    
    _participant_count.frame = CGRectMake(140, 150, 80, 25);
    _participant_count.font = [UIFont systemFontOfSize:15];
    _participant_count.textColor = [UIColor redColor];
    _participant_count.backgroundColor = [UIColor clearColor];
    
    _picImage.frame = CGRectMake(240, 0, 90, 120);
    _picImage.backgroundColor = [UIColor clearColor];
    
  
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
